class DevProjectsController < ApplicationController
skip_before_filter :confirm_logged_in, :only => [:index]
skip_before_filter :confirm_is_admin ,:only =>[:show]
def index
  @DevProjects = DevProject.search(params[:search])
end
  
def new
  @devs = DevProject.new
end

def create
  @devs = DevProject.new(params[:dev_project])
  if @devs.save
    redirect_to dev_projects_path
    else
      render :action =>"new"
    end
  end
def show
  #@devs = DevProject.find(params[:id]).tickets.all
  @project_tickets = DevProject.includes(:tickets => [:status]).where(:id => params[:id])
  @DevProjects = DevProject.all
end
def edit
  @devs = DevProject.find(params[:id])
end
def update
  @devs = DevProject.find(params[:id])
    if @devs.update_attributes(params[:dev_project])
       redirect_to dev_projects_path
    else
      render :action => "edit"
    end
end
def destroy
  @devs = DevProject.find(params[:id])
    @devs.destroy
    redirect_to dev_projects_path
end
end